home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.direct.ca!usenet
- From: qjackson@direct.ca
- Newsgroups: comp.lang.c++
- Subject: Re: class declaration question
- Date: Sat, 20 Jan 1996 18:02:09 GMT
- Organization: Parsepolis Software
- Message-ID: <4drakm$hnu@grid.direct.ca>
- References: <4dphp6$1bp@noc2.drexel.edu>
- Reply-To: qjackson@direct.ca
- NNTP-Posting-Host: 204.174.249.135
- X-Newsreader: Forte Free Agent 1.0.82
-
- st918h5w@dunx1.ocs.drexel.edu (Jonathan Juniman) wrote:
-
- >Is it necessary to do this:
-
- >class SomeClass
- > {
- > public:
- > void Somefunction(int SomeParameter);
- > }
-
- >or is it just as legal to do this:
- >class SomeClass
- > {
- > public:
- > void SomeFunction(int);
- > }
-
- >The latter seems to be the convention, but why does the compiler need to
- >know the name of SomeFunction's argument? Isn't it sufficient to know the
- >type of Somefunction's argument (namely, int)?
-
- The following will compile under Turbo C++ 3.00 -- I don't know what
- the standard is --
-
- class foo
- {
- public:
- void bar (int);
- };
-
- void foo::bar (int baz)
- {
- // do someFoobar
- ++baz;
- }
-
- void main (void)
- {
- foo Chocolate;
- Chocolate.bar(10);
- }
-
- -- \|/ O |
- --+-- Parsepolis Software -*- --|-- Quinn Tyler Jackson
- /|\ "Parse City" /^\ | (aka 'Jamshid')
- >-----------------------------------------------| qjackson@direct.ca
- Ask me about Laleh's Pattern Matcher... |--------------------->
-
-